import Vue from 'vue'
import VueRouter from 'vue-router'

// 2.导入路由对应的组件
import Home from '@/views/portal/Home.vue'
import Movie from '@/views/Movie.vue'

// 1.把 VueRouter 注册为 Vue 的插件
Vue.use(VueRouter)

// 3.创建路由实例对象
const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: Home },
    { path: '/movie', component: Movie }
  ]
})

// 4.共享路由实例对象
export default router
